/***
    Amrita ITEWS - Copyright (C) 2009 Amrita Vishwa Vidyapeetham, Amritapuri.
                                       (http://www.amrita.edu)
    ***************************************************************************
    This file is part of the Amrita ITEWS distribution.
    Amrita ITEWS is free software; you can redistribute it and/or modify it
    under the terms of the GNU General Public License (version 2) as published
    by the Free Software Foundation AND MODIFIED BY the Amrita ITEWS exception.
    ***NOTE*** The exception to the GPL is included to allow you to distribute
    a combined work that includes Amrita ITEWS without being obliged to provide
    the source code for proprietary components outside of the Amrita ITEWS
    software. Amrita ITEWS is distributed in the hope that it will be useful,
    but WITHOUT ANY WARRANTY; without even the implied warranty of
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU General
    Public License for more details. You should have received a copy of the GNU
    General Public License and the Amrita ITEWS license exception along with
    Amrita ITEWS if not then it can be viewed here:
    http://itews.amrita.ac.in/license.html.

    Note: This software is closely coupled to FreeRTOS and hence the
    licensing terms of FreeRTOS would apply.


    Documentation, latest information, license and contact details are at:
    http://itews.amrita.ac.in/


    Amrita ITEWS source code can be found at:
    http://code.google.com/p/itews


    The initial code-base of Amrita ITEWS was developed by Amrita Vishwa
    Vidyapeetham as part of the project titled,"Intelligent & Interactive
    Telematics using Emerging Wireless Technologies for Transport Systems
    (ITEWS)" sponsored by Technology Information Forecasting and Assessment
    Council (TIFAC), India.
***/

#ifndef IGPSU_H_
#define IGPSU_H_

#define IGPSU_DEFAULT_BATTERY_VOLTAGE_RATING 12

/* Board Config Defines */
#define PIN_RELAY1_CNTRL     28 // P0.28, PG0
#define PIN_RELAY2_CNTRL     29 // P0.29, PG1
#define PIN_IGN_INTR         03 // P0.3, PE0
#define PIN_IGN_DETECT       03 // P0.3, PE0 :- Alias for IGN_INTR_PIN
#define PIN_PWR_CAP_24V      22 // P0.22, PG5
#define PIN_PWR_CAP_12V      25 // P0.25, PG4
#define PIN_12V_PWR_STS      10 // P0.10, PD4
#define PIN_24V_PWR_STS      11 // P0.11, PD5
#define PIN_LED0             12 // P0.12, PD2
#define PIN_LED1             13 // P0.13, PD3
#define PIN_LED2             14 // P0.14, PD6
#define PIN_BUZZER           15 // P0.15, PD7

int32 igpsu_open();
int32 igpsu_ignition_is_on();
int32 igpsu_relay_on(uint8);
int32 igpsu_relay_off(uint8);
int32 igpsu_led_on(uint8);
int32 igpsu_led_off(uint8);
int32 igpsu_buzzer_on();
int32 igpsu_buzzer_off();
void igpsu_powerdown();
void igpsu_powerup();
int32 igpsu_get_battery_voltage();

#endif /*IGPSU_H_*/
